<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('管理员信息'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#user_a"><?php echo $this->translate('基本信息'); ?></a></li>
              </ul>
              <form class="form-horizontal" name="user_add_form" id="user_add_form" method="post" action="">
              <input type="hidden" name="user_save_type" id="user_save_type" value="">
              <input type="hidden" name="admin_id" id="admin_id" value="<?php echo ($this->admin_info ? $this->admin_info->admin_id : ''); ?>">
              <input type="hidden" name="adminoper_security" value="<?php echo $this->adminoper_csrf['value']; ?>">
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php if($this->admin_info) echo $this->translate('编辑'); else echo $this->translate('新加'); ?><?php echo $this->translate('管理员'); ?></strong></div>
        			<div class="pull-right">
                	<a href="<?php echo $this->url('adminetutor/default',array('action'=>'administrator','controller'=>'admin')); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回管理员列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                    <?php if($this->admin_info and $this->admin_info->admin_id != 1) { ?>
                    <a href="javascript:;" onclick="return admin_del_js(<?php echo $this->admin_info->admin_id ?>);" class="btn btn-small btn-danger"><i class="icon-remove icon-white"></i> <?php echo $this->translate('删除管理员'); ?></a>&nbsp;
                    <?php } ?>
                	<button type="submit" onclick="$('#user_save_type').val('');" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存管理员信息'); ?></button>&nbsp;
                	<a href="<?php echo $this->myviewalias()->dbshopHelpUrl('admin_set'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
                	</div>
        		</div>
                <div id="user_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well">
                	    <div class="message_one">
                    	</div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('管理员分组'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<select id="admin_group_id" name="admin_group_id" <?php if(isset($this->admin_info) and $this->admin_info->admin_id == 1) echo 'disabled="disabled"'; ?> class="span2">
                                <option value=""><?php echo $this->translate('请选择'); ?></option>
                                <?php if($this->group_array) {
                                	foreach ($this->group_array as $group_val) {
                                ?>
                                <option value="<?php echo $group_val['admin_group_id']; ?>" <?php if($this->admin_info and $this->admin_info->admin_group_id==$group_val['admin_group_id']) { echo 'selected="selected"'; } ?>><?php echo $group_val['admin_group_name']; ?></option>
                                <?php }
                                }
                                ?>
                                </select>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('管理员名称'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="admin_name" name="admin_name" value="<?php echo ($this->admin_info ? $this->admin_info->admin_name : ''); ?>" <?php echo ($this->admin_info ? 'readonly="readonly"' : ''); ?> class="span6">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('电子邮箱'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="admin_email"  name="admin_email"  value="<?php echo ($this->admin_info ? $this->admin_info->admin_email : ''); ?>" class="span6">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('登录密码'); ?><?php if (!$this->admin_info) { ?><span class="must_add_value">*</span><?php } ?>：</label>
           					<div class="controls">
              					<input type="password" id="admin_password"  name="admin_password" class="span3">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('确认密码'); ?><?php if (!$this->admin_info) { ?><span class="must_add_value">*</span><?php } ?>：</label>
           					<div class="controls">
              					<input type="password" id="admin_password_con"  name="admin_password_con" class="span3">
            				</div>                        
                        </div>                        
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('将密码发给该管理员'); ?>：</label>
           					<div class="controls">
              					<input type="checkbox" name="password_email_notice" value="1" id="password_email_notice">
            				</div>                        
                        </div>
                                                                                                                       
                  	</div>
                </div>
             </div>
              </form>
</div>

<script>
$(document).ready(function() {
	$("#user_add_form").validate({
		rules: {
			admin_group_id: {
				required: true
			},
			<?php if (!$this->admin_info) { ?>
			admin_name: {
				required: true,
				maxlength:30,
				remote :{
					url : '<?php echo $this->url('adminetutor/default/admin_id',array('action'=>'checkadmin','controller'=>'admin','check_type'=>'admin_name','admin_id'=>($this->admin_info ? $this->admin_info->admin_id : '0'))); ?>',
					type : 'post',
					date : {
						admin_name :function(){
							return $('#admin_name').val();
						}
					}
				}
			},
			<?php } ?>
			admin_email: {
				required: true,
				email: true,
				remote :{
					url : '<?php echo $this->url('adminetutor/default/admin_id',array('action'=>'checkadmin','controller'=>'admin','check_type'=>'admin_email','admin_id'=>($this->admin_info ? $this->admin_info->admin_id : '0'))); ?>',
					type : 'post',
					date : {
						admin_email :function(){
							return $('#admin_email').val();
						}
					}
				}
			},
			admin_password: {
				<?php if (!$this->admin_info) { ?>
				required: true,
				<?php } ?>
				minlength: 6,
				maxlength: 20
			},
			admin_password_con: {
				<?php if (!$this->admin_info) { ?>
				required: true,
				<?php } ?>
				minlength: 6,
				maxlength: 20,
				equalTo: '#admin_password'
			}
		},
		messages: {
			admin_group_id: {
				required: "<?php echo $this->translate('请选择管理员分组'); ?>"
			},
			<?php if (!$this->admin_info) { ?>
			admin_name: {
				required: "<?php echo $this->translate('请输入管理员登录名称！'); ?>",
				maxlength:"<?php echo $this->translate('管理员登录名称最长为30个汉字！'); ?>",
				remote: "<?php echo $this->translate('该管理员已经存在！'); ?>"
			},
			<?php } ?>
			admin_email: {
				required: "<?php echo $this->translate('请输入电子邮箱！'); ?>",
				email: "<?php echo $this->translate('电子邮箱格式错误！'); ?>",
				remote: "<?php echo $this->translate('该邮箱已经存在'); ?>"
			},
			admin_password: {
				<?php if (!$this->admin_info) { ?>
				required: "<?php echo $this->translate('请输入密码！'); ?>",
				<?php } ?>
				minlength: "<?php echo $this->translate('至少输入6位密码！'); ?>",
				maxlength: "<?php echo $this->translate('密码最长为20位！'); ?>"
			},
			admin_password_con: {
				<?php if (!$this->admin_info) { ?>
				required: "<?php echo $this->translate('请输入确认密码！'); ?>",
				<?php } ?>
				minlength: "<?php echo $this->translate('至少输入6位确认密码！'); ?>",
				maxlength: "<?php echo $this->translate('确认密码最长为20位！'); ?>",
				equalTo: "<?php echo $this->translate('两次输入的密码不一致！'); ?>"
			}
		}
	});
});
<?php if ($this->success_msg != '') { ?>
show_message('.message_one','<?php echo date("Y-m-d H:i:s",time()); ?>','<?php echo $this->success_msg; ?>','alert-success');
<?php } ?>
//管理员删除js
function admin_del_js(admin_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该管理员吗？'); ?>')) {
		$.post("<?php echo $this->url('adminetutor/default',array('action'=>'admindel','controller'=>'admin')); ?>",{admin_id:admin_id},
		function(data){
			if(data != 'false') {
				window.location.href='<?php echo $this->url('adminetutor/default',array('action'=>'administrator','controller'=>'admin')); ?>';
				return true;
			} else {
				alert('<?php echo $this->translate('管理员删除失败！'); ?>');
			}
		});
	}
	return false;
}
</script>